#ifndef __CONTROLLER_H__
#define __CONTROLLER_H__

#include "view/view.h"
#include "model/model.h"

class Controller {
	protected:
		View* view;
		Model* model;
	public:
		Controller(View* view,Model* model){
			this->view = view;
			this->model = model;
		}
		virtual ~Controller(){
			if(this->view)
				delete view;
			if(this->model)
				delete model;
		}

		virtual void display(){
			this->view->display();
		}
		virtual void reshape(float w,float h){
			this->view->reshape(w,h);
		}

		virtual void mouseMotion(float x ,float y)=0;
		virtual void mousePassiveMotion(float x ,float y){}
		virtual void mousePressed(int key,int state,float x ,float y)=0;
		virtual void keyboard(unsigned char key,float x ,float y)=0;
		virtual void notifyViewportLeave()=0;
		virtual void timer(int value)=0;


		View& getView(){ return *view; }
		Model& getModel(){ return *model; }
};

#endif // __CONTROLLER_H__
